package com.example.pojo;


import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 聊天信息表(Chat)实体类
 *
 * @email: pengyujun53@163.com
 * @author: peng_YuJun
 * @date: 2024/01/26
 * @time: 22:39
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_chat")
public class Chat implements Serializable {
    private static final long serialVersionUID = 365878046365928560L;
    
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 发送人id
     */
    private Long fromId;
    /**
     * 接收人id
     */
    private Long toId;
    /**
     * 内容
     */
    private String content;
    /**
     * 发送时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    /**
     * 是否已读标识
     */
    private Integer seen;
    /**
     * 是否删除标识
     */
    private Integer deleted;
}
